package com.sx.gongzhong.pest;


import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.model.VersionBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.IVersionView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin on 2017/12/25.
 * 首页版本信息
 */

public class VersionPest {
    private IVersionView versionView;

    public VersionPest(IVersionView versionView) {
        this.versionView=versionView;
    }

    //获取站内列表
    public void getVersion(){
        Map<String,Object> map = new HashMap<>();
        new ApiManager().getVersionMessage(map, new BaseCallBack<ReplyUserBean.BaseResult<VersionBean>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<VersionBean> response) {
                versionView.getVersion(response.getData());
            }
            @Override
            public void onFailures(String message) {
                versionView.showError(message);
            }
        });
    }
}